import Vue from 'vue'
import drawer from './src'

const drawerDom = Vue.extend(drawer)

const DrawerBox = option => {
  let instance = new drawerDom({
    el: document.createElement('div')
  })
  instance.show = true
  instance.title = option.title
  instance.component = option.component
  instance.data = option.data
  instance.width = option.width ? option.width : '520px'
  instance.close = data => {
    typeof option.close == 'function' && option.close(data)
  }
}

export default DrawerBox
